﻿CREATE PROCEDURE [dbo].[ETL_SP_SearchVDtSerPagedList]
	@folderId uniqueidentifier,
	@filter nvarchar(64),
	@start int,
	@limit int
AS
SELECT T.* from(
	SELECT
		ROW_NUMBER() OVER(Order BY DS.Name) as _RowIndex,
		DS.*,
		[dbo].ETL_Func_GetMappedDtSourceCount(DS.Id) as MappedCount,
		[dbo].ETL_Func_GetUnmappedDtSourceCount(DS.Id) as UnmappedCount
	FROM ETL_DtSer as DS
	WHERE
		DS.FolderId=@folderId and DS.Name like '%'+@filter+'%'
	) as T
where T._RowIndex > @start and T._RowIndex <= @start+@limit;

RETURN 0